package src.lab02.test11;

/**
 * Created by MECHREV on 2017/10/25.
 */
public class Square extends Rectangle {
    double side;
    double diagonal(){return (Math.sqrt(side*side+side*side));}
    @Override
    double area() {
        return super.area();
    }

    @Override
    double perimeter() {
        return super.perimeter();

    }

    @Override
    public void printMyWay() {
        super.printMyWay();
        System.out.println("边长");
        System.out.println(side);
        System.out.println("周长");
        System.out.println(perimeter());
        System.out.println("面积");
        System.out.println(area());
        System.out.println("对角线");
        System.out.println(Math.sqrt(side*side+side*side));

    }

    public static void main(String[] args) {

    }

}
